package com.clwl.supervise.superviseapp.entity.risk;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 风险等级评定
 */
@Data
@TableName(value = "JG_RISK_LEVEL")
//@KeySequence("JG_RISK_LEVEL_SQE")
public class JgRiskLevel implements Serializable {
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    /**
     * 企业id
     */
    @TableField(value = "COMPANY_ID")
    private Long companyId;

    /**
     * 企业名称
     */
    @TableField(value = "COMPANY_NAME")
    private String companyName;

    /**
     * 统一会社信用代码
     */
    @TableField(value = "CREDIT_CODE")
    private String creditCode;

    /**
     * 许可证编码
     */
    @TableField(value = "LICENSE")
    private String license;

    /**
     * 评级年度
     */
    @TableField(value = "RISK_YEAR")
    private String riskYear;

    /**
     * 评级时间
     */
    @TableField(value = "RISK_TIME")
    private String riskTime;

    /**
     * 动态评分id(属于初次动态评分了)
     */
    @TableField(value = "DYNAMIC_ID")
    private Long dynamicId;

    /**
     * 静态评分id
     */
    @TableField(value = "STATIC_ID")
    private Long staticId;


    /**
     * 动态-检查评分(即动态总分)
     */
    @TableField(value = "DYNAMIC_CHECK_SCORE")
    private Double dynamicCheckScore;

    /**
     * 抽样分数
     */
    @TableField(value = "SAMPLING_SCORE")
    private Double samplingScore;

    /**
     * 约谈分数
     */
    @TableField(value = "APPOINTMENT_SCORE")
    private Double appointmentScore;

    /**
     * 核减分值
     */
    @TableField(value = "DYNAMIC_MINUS_SCORE")
    private Double dynamicMinusScore;

    /**
     * 风险评级总分（最后评级的得分）
     */
    @TableField(value = "DYNAMIC_LEVEL_SCORE")
    private Double dynamicLevelScore;

    /**
     * 静态-食品类别分
     */
    @TableField(value = "STATIC_SPLB_SCORE")
    private Double staticSplbScore;

    /**
     * 静态-规模分
     */
    @TableField(value = "STATIC_SCALE_SCORE")
    private Double staticScaleScore;

    /**
     * 静态-食品生产许可现场核查分
     */
    @TableField(value = "STATIC_CHECK_SCORE")
    private Double staticCheckScore;

    /**
     * 等级调整原因
     */
    @TableField(value = "ADJUST_REASON")
    private String adjustReason;

    /**
     * 从业人员数量
     */
    @TableField(value = "PERSON_TOTAL")
    private Long personTotal;

    /**
     * 年度营业收入（万元）
     */
    @TableField(value = "ANNUAL_INCOME")
    private BigDecimal annualIncome;

    /**
     * 是否是已认证企业（1：ISO9000，2：HCCP，3：gmp，4：ISO2002，5：其他）
     */
    @TableField(value = "IS_RENZHENG")
    private String isRenzheng;

    /**
     * 是否信息化追溯企业：0否，1是
     */
    @TableField(value = "IS_ZHUISU")
    private String isZhuisu;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    private Date createTime;

    /**
     * 创建人id
     */
    @TableField(value = "CREATOR_ID")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField(value = "CREATOR")
    private String creator;

    /**
     * 创建人部门id
     */
    @TableField(value = "CREATE_DEPT_ID")
    private Long createDeptId;

    /**
     * 创建人部门名称
     */
    @TableField(value = "CREATE_DEPT_NAME")
    private String createDeptName;

    /**
     * 是否删除：0-否，1-是
     */
    @TableField(value = "DELETE_FLAG")
    private Integer deleteFlag;

    /**
     * 审核人
     */
    @TableField(value = "EXAMINE_PERSONNEL")
    private String examinePersonnel;

    /**
     * 审核结果：0-不通过，1-通过，2-待审核
     */
    @TableField(value = "EXAMINE_RESULT")
    private String examineResult;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "EXAMINE_TIME")
    private Date examineTime;


    /**
     * 审核时间回显
     */
    @TableField(exist = false)
    private String examineTimeStr;


    /**
     * 审核人id
     */
    @TableField(value = "EXAMINE_PERSONNEL_ID")
    private Long examinePersonnelId;

    /**
     * 风险等级
     */
    @TableField(value = "RISK_LEVEL")
    private String riskLevel;

    /**
     * 审核意见
     */
    @TableField(value = "EXAMINE_OPINION")
    private String examineOpinion;

    /**
     * 普众风险评级id
     */
    @TableField(value = "PZID")
    private String pzid;

    /**
     * 静态总分
     */
    @TableField(value = "STATIC_SCORE")
    private Double staticScore;

    /**
     * 信用评分
     */
    @TableField(value = "CREDIT_SCORE")
    private Double creditScore;

    /**
     * 食用人群：字典risk_level_consumer
     */
    @TableField(value = "CONSUMER_GROUP")
    private String consumerGroup;


    /**
     * 动态检查分值
     */
    @TableField(value = "DYNAMIC_SCORE")
    private Double dynamicScore;
    /**
     * 信用基础分值
     */
    @TableField(value = "CREDIT_BASE_SCORE")
    private Double creditBaseScore;

    @TableField(value = "IS_GONGPI")
    private String isGongpi;

    @TableField(value = "IS_XIAOYUAN")
    private String isXiaoyuan;
    /**
     * 是否设座小餐饮(固定食品制售摊贩中的)：0否，1是
     */
    @TableField(value = "IS_SHEZUO")
    private String isShezuo;

    /**
     * 确认表(只有经营企业存储)
     */
    @TableField(value = "CONFIRM_TABLE")
    private String confirmTable;
    /**
     * 调整等级数
     */
    @TableField(value = "ADJUST_LEVEL")
    private Integer adjustLevel;
    /**
     * 数据来源类型(APP、PC)
     */
    @TableField(value = "SOURCE_TYPE")
    private String sourceType;
    /**
     * 上一年风险等级
     */
    @TableField(exist = false)
    private String lastYearLevel;
    /**
     * 企业地址，页面显示用
     */
    @TableField(exist = false)
    private String companyAddress;
/*    *//**
     * 静态评分限定值
     *//*
    @TableField(exist = false)
    private Double staticMaxScore;

    *//**
     * 动态评分限定值
     *//*
    @TableField(exist = false)
    private Double dynamicMaxScore;

    *//**
     * 信用评分限定值
     *//*
    @TableField(exist = false)
    private Double creditMaxScore;*/

    /**
     * 联系人
     */
    @TableField(exist = false)
    private String contacts;

    /**
     * 联系方式
     */
    @TableField(exist = false)
    private String ContactInformation;

    /**
     * 类别（生产环节）
     */
    @TableField(exist = false)
    private String supProcess;

    /**
     * 类别名称（生产环节）
     */
    @TableField(exist = false)
    private String supProcessName;

    /**
     * 类别名称（一级业态）
     */
    @TableField(exist = false)
    private String companyTypeOne;
    /**
     * 页面提示消息
     */
    @TableField(exist = false)
    private String message;
    /**
     * 主体业态细类id
     */
    @TableField(exist = false)
    private Long companyTypeTwoId;

    /**
     * 主体业态id
     */
    @TableField(exist = false)
    private Long companyTypeId;


    /**
     * 食用人群选项
     */
    @TableField(exist = false)
    private List<Map<String, Object>> consumerGroupList;

    /**
     * 风险动态调整内容
     */
    @TableField(exist = false)
    private List<JgRiskLevelDynamic> riskLevelDynamicList;

    /**
     * 风险动态调整内容
     */
    @TableField(exist = false)
    private List<JgRiskGradeScore> riskGradeScoreList;
    /**
     * 信用评分自定义
     */
    @TableField(exist = false)
    private List<JgCreditCustomScore> creditCustomScoreList;
    /**
     * 动态评分自定义
     */
    @TableField(exist = false)
    private List<JgDynamicCustomScore> dynamicCustomScoreList;

    /**
     * 静态评分自定义
     */
    @TableField(exist = false)
    private List<JgStaticCustomScore> staticCustomScoreList;


    private static final long serialVersionUID = 1L;
}
